package com.atXiao.factory;

import com.atXiao.design.PaymentStrategy;
import com.atXiao.design.PaymentStrategyFactory;
import com.atXiao.strategy.CreditCardStrategy;

// 实现信用卡策略工厂类
class CreditCardStrategyFactory implements PaymentStrategyFactory {
    private String name;
    private String cardNumber;
    private String cvv;
    private String dateOfExpiry;

    public CreditCardStrategyFactory(String name, String cardNumber, String cvv, String dateOfExpiry) {
        this.name = name;
        this.cardNumber = cardNumber;
        this.cvv = cvv;
        this.dateOfExpiry = dateOfExpiry;
    }

    @Override
    public PaymentStrategy createPaymentStrategy() {
        return new CreditCardStrategy(name, cardNumber, cvv, dateOfExpiry);
    }
}